import {
    ApiVersion
} from '../httpConfig'
import Axios from 'axios'

/**
 * 文章
 * */
export const ArticlesUrl = {
    // 获取所有文章
    articlesByPagesRes: ApiVersion + 'articles/',
    addArticlesRes: ApiVersion + 'articles/add',
    articlesDetailRes: ApiVersion + 'articles/'

}

/**
 * 文章
 */
const ArticlesApi = {
    // 获取所有文章
    getArticlesByPages: data => {
        return Axios.post(ArticlesUrl.articlesByPagesRes, data)
    },
    /**
     * 增加文章
     */
    addArticles: data => {
        return Axios.post(ArticlesUrl.addArticlesRes, data)
    },
    /**
     * 获取文章详情
     */
    getArticlesDetail: articleID => {
        return Axios.get(ArticlesUrl.articlesDetailRes + articleID)
    }
}
export default ArticlesApi
